#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.14.2
 Author:         changeMic

 Script Function:
	Change microphone effect.

#ce ----------------------------------------------------------------------------

#NoTrayIcon
#include <GuiListView.au3>

$TitleRec="Sound"
$TitlePro="Microphone Properties"

run("C:\WINDOWS\SYSTEM32\rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,recording", "C:\WINDOWS\SYSTEM32\")

WinWait($TitleRec)
ConsoleWrite(ControlListView($TitleRec, '', "[CLASS:SysListView32; INSTANCE:1]","GetItemCount"))
If ControlListView($TitleRec, '', "[CLASS:SysListView32; INSTANCE:1]","GetItemCount") <> 2 Then
   MsgBox(48, "Error", "Microphone is missing!!!")
   ControlClick($TitleRec,"","[CLASS:Button; INSTANCE:4]")
   Exit (1)
EndIf

ControlListView($TitleRec, '', "[CLASS:SysListView32; INSTANCE:1]","Select",0)
ControlClick($TitleRec, '', "[CLASS:Button; INSTANCE:3]")

Sleep(500)
ControlCommand($TitlePro,"", "[CLASS:SysTabControl32; INSTANCE:1]","TabRight")
Sleep(500)
ControlCommand($TitlePro,"", "[CLASS:SysTabControl32; INSTANCE:1]","TabRight")
Sleep(500)
ControlCommand($TitlePro,"", "[CLASS:SysTabControl32; INSTANCE:1]","TabRight")

Sleep(500)
$handle=ControlGetHandle($TitlePro, '', "[CLASS:SysListView32; INSTANCE:1]")

_GUICtrlListView_SetItemChecked($handle, 0, True);
Sleep(500)
_GUICtrlListView_SetItemChecked($handle, 1, False);
Sleep(500)
_GUICtrlListView_SetItemChecked($handle, 2, True);

Sleep(500)
ControlClick($TitlePro,"","[CLASS:Button; INSTANCE:12]")

Sleep(500)
ControlClick($TitleRec,"","[CLASS:Button; INSTANCE:4]")

